/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package mnstudent.global;

import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;

public class MyTableCellRender extends DefaultTableCellRenderer {

    public MyTableCellRender() {
        setOpaque(true);
    }
    int i = 0;

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus, int row, int column) {
        setText(value != null ? value.toString() : "");
        if (isSelected) {
            setBackground(Color.lightGray);
            //System.out.println(row);
        } else if (((MyTable) table).m_isAdd) {
            //setBackground(Color.LIGHT_GRAY);
            setForeground(Color.black);
        }
        return this;
    }
}
